package com.itheima;

/**
 * 2025/3/24 20:23
 * 复利的练习
 */
public class WhilePractice1 {
    public static void main(String[] args) {

        double money = 1;
        int n = 0;
        while (money < 2) {
//            money *= 1.017;
            money = money * 1.05;
            //记录存款的年数
            n++;
        }
        System.out.println("第" + n + "年，存款为：" + money);



    }
}
